package com.xinruke.hostels.common.vo.query;

import java.util.List;

/**
 * @ClassName Condition
 * @CreateDate 2019/6/8
 * @Author FengXinQiang
 * @Version V1.0.0.0
 * @Decription 查询条件对象
 */
public class Condition {
    /**
     * 字段
     */
    private String field;
    /**
     * 查询操作符：= like <= >=  is in
     */
    private EConditionOperator operator;
    /**
     * 值
     */
    private Object value;
    /**
     * 起始值
     */
    private Object valueStart;
    /**
     * 结束值
     */
    private Object valueEnd;
    /**
     * 值集合
     */
    private List<Object> valueList;
    /**
     * 数据类型：string date long
     */
    private String dataType;

    /**
     * 构造器
     *
     * @param field
     * @param operator
     * @param value
     */
    public Condition(String field, EConditionOperator operator, Object value) {
        this.field = field;
        this.operator = operator;
        this.value = value;
    }

    /**
     * 构造器
     *
     * @param field
     * @param valueStart
     * @param valueEnd
     */
    public Condition(String field, Object valueStart, Object valueEnd) {
        this.field = field;
        this.operator = EConditionOperator.BETWEEN;
        this.valueStart = valueStart;
        this.valueEnd = valueEnd;
    }

    /**
     * 构造器
     *
     * @param field
     * @param valueList
     */
    public Condition(String field, List<Object> valueList) {
        this.field = field;
        this.operator = EConditionOperator.IN;
        this.valueList = valueList;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public EConditionOperator getOperator() {
        return operator;
    }

    public void setOperator(EConditionOperator operator) {
        this.operator = operator;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Object getValueStart() {
        return valueStart;
    }

    public void setValueStart(String valueStart) {
        this.value = valueStart;
    }

    public Object getValueEnd() {
        return valueEnd;
    }

    public void setValueEnd(String valueEnd) {
        this.valueEnd = valueEnd;
    }

    public List<Object> getValueList() {
        return valueList;
    }

    public void setValueList(List<Object> valueList) {
        this.valueList = valueList;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

}
